package com.battery.system.domain;

import java.math.BigDecimal;
import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.battery.common.annotation.Excel;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;

/**
 * 租借授权对象 ws_auth_used
 *
 * @author battery
 * @date 2021-01-22
 */
@Table(name = "ws_auth_used")
public class AuthUsed {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @Id
    @KeySql(useGeneratedKeys = true)
    private String usedId;

    /**
     * 微信商户服务订单号out_order_no 或 支付宝商户授权资金订单号
     */
    @Excel(name = "微信商户服务订单号out_order_no 或 支付宝商户授权资金订单号")
    private String outOrderNo;

    /**
     * 微信支付服务订单号order_id 或 支付宝请求流水号
     */
    @Excel(name = "微信支付服务订单号order_id 或 支付宝请求流水号")
    private String ticket;

    /**
     * 冻结金额
     */
    @Excel(name = "冻结金额")
    private BigDecimal amount;

    /**
     * 支付宝预授权订单状态 采用跟微信一致的状态吧微信支付分订单状态：CREATED：商户已创建服务订单； DOING：服务订单进行中； DONE：服务订单完成； REVOKED：商户取消服务订单；  EXPIRED：服务订单已失效，"商户已创建服务订单"状态超过30天未变动，则订单失效
     */
    @Excel(name = "支付宝预授权订单状态 采用跟微信一致的状态吧微信支付分订单状态：CREATED：商户已创建服务订单； DOING：服务订单进行中； DONE：服务订单完成； REVOKED：商户取消服务订单；  EXPIRED：服务订单已失效，'商户已创建服务订单'状态超过30天未变动，则订单失效")
    private String state;

    /**
     * 微信支付分订单状态描述对服务订单"进行中"状态的附加说明：USER_CONFIRM：用户确认MCH_COMPLETE：商户完结对 DONE：服务订单完成的说明USER_PAYING：待支付 USER_PAID：已支付 支付宝FREEZE 冻结UNFREEZE 解冻PAY 支付
     */
    @Excel(name = "微信支付分订单状态描述对服务订单'行中'状态的附加说明：USER_CONFIRM：用户确认MCH_COMPLETE：商户完结对 DONE：服务订单完成的说明USER_PAYING：待支付 USER_PAID：已支付 支付宝FREEZE 冻结UNFREEZE 解冻PAY 支付")
    private String stateDescription;

    /**
     * 微信结单交易单号 同 支付宝trade_no支付宝交易号
     */
    @Excel(name = "微信结单交易单号 同 支付宝trade_no支付宝交易号")
    private String transactionId;

    /**
     * 支付宝的资金授权订单号【支付宝】
     */
    @Excel(name = "支付宝的资金授权订单号【支付宝】")
    private String authNo;

    /**
     * 支付宝的资金操作流水号【支付宝】
     */
    @Excel(name = "支付宝的资金操作流水号【支付宝】")
    private String operationId;

    /**
     * 【支付宝】支付宝预授权类型：CREDIT_AUTH(信用预授权)其他为普通资金预授权
     */
    @Excel(name = "【支付宝】支付宝预授权类型：CREDIT_AUTH(信用预授权)其他为普通资金预授权")
    private String preAuthType;

    /**
     * 创建时间
     */
    private Date createTime;


    private String appUserId;


    public String getAppUserId() {
        return appUserId;
    }

    public void setAppUserId(String appUserId) {
        this.appUserId = appUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public void setUsedId(String usedId) {
        this.usedId = usedId;
    }

    public String getUsedId() {
        return usedId;
    }

    public void setOutOrderNo(String outOrderNo) {
        this.outOrderNo = outOrderNo;
    }

    public String getOutOrderNo() {
        return outOrderNo;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    public String getTicket() {
        return ticket;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getState() {
        return state;
    }

    public void setStateDescription(String stateDescription) {
        this.stateDescription = stateDescription;
    }

    public String getStateDescription() {
        return stateDescription;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setAuthNo(String authNo) {
        this.authNo = authNo;
    }

    public String getAuthNo() {
        return authNo;
    }

    public void setOperationId(String operationId) {
        this.operationId = operationId;
    }

    public String getOperationId() {
        return operationId;
    }

    public void setPreAuthType(String preAuthType) {
        this.preAuthType = preAuthType;
    }

    public String getPreAuthType() {
        return preAuthType;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("usedId", getUsedId())
                .append("outOrderNo", getOutOrderNo())
                .append("ticket", getTicket())
                .append("amount", getAmount())
                .append("state", getState())
                .append("stateDescription", getStateDescription())
                .append("transactionId", getTransactionId())
                .append("authNo", getAuthNo())
                .append("operationId", getOperationId())
                .append("preAuthType", getPreAuthType())
                .toString();
    }
}
